//
//  CIBHomeListCell.m
//  CIBN
//
//  Created by ZNGOO on 16/7/19.
//  Copyright © 2016年 韦儒健. All rights reserved.
//

#import "CIBHomeListCell.h"


@implementation CIBHomeListCell

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.home_imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.width * 16/9)];
        [self addSubview:self.home_imageView];
        
        self.home_titlelabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.home_imageView.frame) + 2, frame.size.width, 18)];
        self.home_titlelabel.font = [UIFont systemFontOfSize:14];
        [self addSubview:self.home_titlelabel];
    }
    return self;
}

- (void)setHomeCell:(CIBNHomeListModel *)model recomend:(NSUInteger)index{
    
    switch (index) {
        case 0:
        {
            [self.home_imageView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://42.62.117.43:8080/play?fid=%@",model.img]]];
            
            
            self.home_titlelabel.text = model.displayname;
        }
            break;
            
        default:
        {
            [self.home_imageView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://42.62.117.43:8080/play?fid=%@",model.posterfid]]];
            
            
            self.home_titlelabel.text = model.vname;
        }
            break;
    }

    
    
}
@end
